<?php

namespace app\admin\model\resume;

use think\Model;


class Resume extends Model
{

    

    

    // 表名
    protected $name = 'resume_basicinfo';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'Gender_text',
        'MaritalStatus_text',
        'JobSearchStatus_text'
    ];
    

    
    public function getGenderList()
    {
        return ['1' => __('Gender 1'), '2' => __('Gender 2')];
    }

    public function getMaritalstatusList()
    {
        return ['1' => __('Maritalstatus 1'), '2' => __('Maritalstatus 2'), '3' => __('Maritalstatus 3')];
    }

    public function getJobsearchstatusList()
    {
        return ['1' => __('Jobsearchstatus 1'), '2' => __('Jobsearchstatus 2'), '3' => __('Jobsearchstatus 3'), '4' => __('Jobsearchstatus 4')];
    }


    public function getGenderTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['Gender']) ? $data['Gender'] : '');
        $list = $this->getGenderList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMaritalstatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['MaritalStatus']) ? $data['MaritalStatus'] : '');
        $list = $this->getMaritalstatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getJobsearchstatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['JobSearchStatus']) ? $data['JobSearchStatus'] : '');
        $list = $this->getJobsearchstatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
